# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

workspace(name = "centos7")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load(":revisions.bzl", "RULES_DOCKER")

http_archive(
    name = "io_bazel_rules_docker",
    sha256 = RULES_DOCKER.sha256,
    strip_prefix = "rules_docker-" + RULES_DOCKER.commit,
    urls = ["https://github.com/bazelbuild/rules_docker/archive/" + RULES_DOCKER.commit + ".tar.gz"],
)

http_archive(
    name = "bazel_skylib",
    # Commit c00ef493869e2966d47508e8625aae723a4a3054 of 2018-12-10
    sha256 = "7363ae6721c1648017e23a200013510c9e71ca69f398d52886ee6af7f26af436",
    strip_prefix = "bazel-skylib-c00ef493869e2966d47508e8625aae723a4a3054",
    urls = ["https://github.com/bazelbuild/bazel-skylib/archive/c00ef493869e2966d47508e8625aae723a4a3054.tar.gz"],
)

load(
    "@io_bazel_rules_docker//repositories:repositories.bzl",
    container_repositories = "repositories",
)

container_repositories()

load("@io_bazel_rules_docker//repositories:deps.bzl", container_deps = "deps")

container_deps()

load("@io_bazel_rules_docker//repositories:pip_repositories.bzl", "pip_deps")

pip_deps()

load(
    "@io_bazel_rules_docker//container:container.bzl",
    "container_pull",
)

# Pull existing Centos base, only used by File Update Service to create a new
# Centos base tarball.
container_pull(
    name = "centos_base",
    registry = "l.gcr.io",
    repository = "google/centos7",
    tag = "latest",
)

load(":centos_rpm.bzl", "centos_rpm")

# Non-deterministic latest version of Centos 7 release rpm. This is used by
# File Update Service to archive each version in our managed GCS bucket, and
# should NOT be used by container release directly.
centos_rpm(
    name = "centos7_latest",
    version = 7,
)

load(":deps.bzl", "deps")

deps()
